#ifndef _RESOURCEMANAGER_H
#define _RESOURCEMANAGER_H

#include <string>
#include <map>
#include <vector>

#include "StringUtils.h"
#include "Logger.h"
#include "Shader.h"
#include "Singleton.h"
#include "Texture.h"
#include "Font.h"

#ifdef GALLIUMENGINE_DLL 
#define GALLIUMENGINE_API __declspec( dllexport )
#else
#define GALLIUMENGINE_API __declspec( dllimport )
#endif

namespace GalliumEngine
{
	class SceneManager;

	class ResourceManager :  public Singleton<ResourceManager>
	{
	private:
		typedef std::map<std::string,Texture*> textures_map;
		typedef textures_map::iterator textures_map_itr;
		typedef textures_map::const_iterator textures_map_const_itr;
		typedef std::pair<std::string,Texture*> textures_pair;

		typedef std::map<std::string,Shader*> shaders_map;
		typedef shaders_map::iterator shaders_map_itr;
		typedef shaders_map::const_iterator shaders_map_const_itr;
		typedef std::pair<std::string,Shader*> shaders_pair;

		typedef std::map<std::string,Font*> fonts_map;
		typedef fonts_map::iterator fonts_map_itr;
		typedef fonts_map::const_iterator fonts_map_const_itr;
		typedef std::pair<std::string,Font*> fonts_pair;

		std::map<std::string,textures_map> textures;
		std::map<std::string,shaders_map> shaders;
		std::map<std::string,fonts_map> fonts;
	public:
		GALLIUMENGINE_API ResourceManager();
		GALLIUMENGINE_API ~ResourceManager();

		GALLIUMENGINE_API void release(std::string sceneName);
		GALLIUMENGINE_API void releaseAll();

		GALLIUMENGINE_API void addScene(std::string sceneName);

		GALLIUMENGINE_API Texture* loadTexture(std::string file);

		GALLIUMENGINE_API Font* loadFont(std::string file,
			int size);

		GALLIUMENGINE_API Shader* loadShader(std::string shaderId,
			std::string vertexShader,
			std::string geometryShader,
			std::string fragmentShader,
			std::vector<BindParams> params);
	};

}

#endif
